home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / usr / share / hplip / devicesettings.pyc (.txt) < prev    next >
Python Compiled Bytecode  |  2009-10-28  |  2KB  |  52 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. __version__ = '0.1'
  5. __title__ = 'Device Setup Utility'
  6. __mod__ = 'hp-devicesettings'
  7. __doc__ = 'Device settings utility for HPLIP supported printers. (Note: Not all printers require the use of this utility).'
  8. import sys
  9. import re
  10. import getopt
  11. import time
  12. import operator
  13. import os
  14. from base.g import *
  15. from base import device, utils, maint, tui, module
  16. from prnt import cups
  17.  
  18. try:
  19.     mod = module.Module(__mod__, __title__, __version__, __doc__, None, (GUI_MODE,), (UI_TOOLKIT_QT4,))
  20.     mod.setUsage(module.USAGE_FLAG_DEVICE_ARGS, see_also_list = [
  21.         'hp-toolbox'])
  22.     (opts, device_uri, printer_name, mode, ui_toolkit, lang) = mod.parseStdOpts()
  23.     device_uri = mod.getDeviceUri(device_uri, printer_name, filter = {
  24.         'power-settings': (operator.gt, 0) })
  25.     if not utils.canEnterGUIMode4():
  26.         log.error('%s -u/--gui requires Qt4 GUI support. Exiting.' % __mod__)
  27.         sys.exit(1)
  28.     
  29.     
  30.     try:
  31.         from PyQt4.QtGui import QApplication
  32.         from ui4.devicesetupdialog import DeviceSetupDialog
  33.     except ImportError:
  34.         log.error('Unable to load Qt4 support. Is it installed?')
  35.         sys.exit(1)
  36.  
  37.     app = QApplication(sys.argv)
  38.     dlg = DeviceSetupDialog(None, device_uri)
  39.     dlg.show()
  40.     
  41.     try:
  42.         log.debug('Starting GUI loop...')
  43.         app.exec_()
  44.     except KeyboardInterrupt:
  45.         sys.exit(0)
  46.  
  47. except KeyboardInterrupt:
  48.     log.error('User exit')
  49.  
  50. log.info('')
  51. log.info('Done.')
  52.